package test.db.mysql.table;

public enum QuestionAttachFileTable implements Table {
    SID(Column.sid),
    ATTACH_ORDER(Column.attachOrder),
    FILE_NAME(Column.fileName),
    ORIGINAL_FILE_NAME(Column.originalFileName),
    FILE_SIZE(Column.fileSize),
    FILE_EXTENSION(Column.fileExtension),
    ATTACH_TYPE(Column.attachType),
    QUESTION_SID(Column.questionSid);
    
    private final Column column;
    private static final String TYPE_SID = "VARCHAR(20)";
    private static final String TYPE_ATTACH_ORDER = "VARCHAR(2)";
    private static final String TYPE_FILE_NAME = "VARCHAR(20)";
    private static final String TYPE_ORIGINAL_FILE_NAME = "VARCHAR(512)";
    private static final String TYPE_FILE_SIZE = "VARCHAR(12)";
    private static final String TYPE_FILE_EXTENSION = "VARCHAR(12)";
    private static final String TYPE_ATTACH_TYPE = "VARCHAR(12)";
    private static final String TYPE_QUESTION_SID = "VARCHAR(20)";

    QuestionAttachFileTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        attachOrder {
            String getType() {
                return TYPE_ATTACH_ORDER;
            }
        },
        
        fileName {
            String getType() {
                return TYPE_FILE_NAME;
            }
        },
        
        originalFileName {
            String getType() {
                return TYPE_ORIGINAL_FILE_NAME;
            }
        },
        
        fileSize {
            String getType() {
                return TYPE_FILE_SIZE;
            }
        },
        
        fileExtension {
            String getType() {
                return TYPE_FILE_EXTENSION;
            }
        },
        
        attachType {
            String getType() {
                return TYPE_ATTACH_TYPE;
            }
        },
        
        questionSid {
            String getType() {
                return TYPE_QUESTION_SID;
            }
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
        System.out.println("CALL NOW");
    }
}